<template>
<div id="headerTop">
	<img :src="item.src"  style="border:0;"  id="imgHeader"  @click="flag && back()">
    <span >{{item.headerText}}</span>
    <span class="img"  @click='toNext'>{{item.right}}</span>
</div>
</template>

<script>
export default {
  props:{
      item: {}
  },
  data(){
  	return{
  		flag:true
  	}
  },
  methods:{
     back(){
     	this.$router.back(-1);
     },
     toNext(){
          this.$emit('toNext')
     }
  },
  mounted(){
  	if(document.getElementById("imgHeader").getAttribute("src")==""){
  		this.flag=false;
  		document.getElementById("imgHeader").removeAttribute("src");
  		
  	}
  }
}
</script>

<style lang="less" scoped>
@import '../less/config.less';
#headerTop{
  	
	padding:0 @p30;
	display: flex;
	justify-content:space-between;
	align-items: center;
	height:@hwrap;
	color:#fff;
	font-size:.48rem;
	background: #000000;
	img,.img{
		border: none;
		width: auto;
		height: @p30;
	}
	img:not([src]){
		opacity:0;
	}

}
</style>
